Xbasic

SQL::ConnectionGenerateNativeTypeString Method

Syntax

Type_String as C = GenerateNativeTypeString as C (TypeInfo as SQL::DataTypeInfo [,TableInfo as SQL::TableInfo])

Arguments

TypeInfoSQL::DataTypeInfo

SQL::DataTypeInfo

TableInfoSQL::TableInfo

SQL::TableInfo

Returns

Type_StringCharacter

The data type used for the field on the back-end database.

Description

Generate a SQL type string for type passed in using the current syntax. TableInfo is optional, but provides additional information that is useful.

Discussion

The GenerateNativeTypeString method generates a SQL type string for type passed in using the current syntax.

Example

dim conn as SQL::Connection
dim rs as SQL::ResultSet
dim cr as SQL::Row
dim dti as SQL::DataTypeInfo
dim connString as C
dim select_exp as C
connString = "{A5API='Access', FileName='c:\program files\a5v8\mdbfiles\alphasports.mdb'}"
select_exp = "select Lastname from customer where bill_state_region = 'ma'"
if .not. conn.open(connString)
    ui_msg_box("Error", conn.CallResult.text)
    end
end if
if .not. conn.execute(select_exp)
    ui_msg_box("Error", conn.CallResult.text)
    end
end if
rs = conn.ResultSet
rs.NextRow()
cr = rs.CurrentRow
dti = cr.ColumnInfo1
ui_msg_box("Native Type String", conn.GenerateNativeTypeString(dti))
conn.close()

See Also